package ch07;

class _24_InterfaceTest2 {
	public static void main(String[] args) {
		A24 a = new A24();
		a.autoPlay(new B24());
		a.autoPlay(new C24());
	}
}

class A24 {
	void autoPlay(I i) {
		i.play();
	}
}

interface I {
	public abstract void play();
}

class B24 implements I {
	public void play() {
		System.out.println("play in B class");
	}
}

class C24 implements I {
	public void play() {
		System.out.println("play in C class");
	}
}
/*
 * play in B class play in C class
 */
